<template>
  <h1>v-for 循环对象</h1>
  <p v-for="(value,key) of user">
    {{ value }}<br>
    <template v-if="key==='love'">
      <ul>
        <li v-for="item in user.love">{{ item }}</li>
      </ul>
    </template>
  </p>
  <hr>
  <p v-for="(a,b) in {id:99,name:'李四',age:18,score:60,address:'河南省郑州市'}">
    user.{{ b }} = {{ a }}<br>
  </p>
  <hr>
  <p v-for="(value,key,index) in {id:99,name:'李四',age:18,score:60,address:'河南省郑州市'}">
    {{ index }}、user.{{ key }} = {{ value }}<br>
  </p>
  <hr>
</template>
<script lang="ts" setup>
import {ref} from 'vue'

const user = ref({id: 99, name: '李四', age: 18, score: 60, address: '河南省郑州市', love: ['音乐', '运动', '游戏', '打篮球']})
</script>
